type ClassNameCalcProps = {
  isActive: boolean;
  isPending: boolean;
};

const normalClasses = 'btn btn-ghost text-sm';
const pendingClasses = 'btn btn-active text-sm';
const disabledClasses = 'btn btn-outline btn-error text-sm';
const activeClasses = 'btn btn-active btn-accent text-sm';

export const classNameFn =
  (disabled?: boolean) =>
  ({ isActive, isPending }: ClassNameCalcProps) => {
    if (disabled) {
      return disabledClasses;
    }

    if (isPending) {
      return pendingClasses;
    }

    if (isActive) {
      return activeClasses;
    }

    return normalClasses;
  };
